package day6homework;

public class Rectangle {
	private int width;
	private int height;
	
	public Rectangle() {
		this.width = 1;
		this.height = 1;
	}
	
	public Rectangle(int width) {
		this.width = width;
		this.height = width;
	}
	
	public Rectangle(int width,int height) {
		this.width = width;
		this.height = height;
	}
	//计算周长
	public int getPerimeter() {
		return 2 * (width + height);
	}
	//计算面积
	public int getArea() {
		return width * height;
	}
}
